package com.kunya.product.dao.category;

import com.kunya.product.po.ProductCategory;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductCategoryMapper {
    int deleteByPrimaryKey(@Param("productCategoryId") Long productCategoryId ,@Param("table_prefix") String table_prefix);

    int insert(@Param("record") ProductCategory record,@Param("table_prefix") String table_prefix);

    int insertSelective(@Param("record") ProductCategory record,@Param("table_prefix") String table_prefix);

    ProductCategory selectByPrimaryKey(@Param("productCategoryId") Long productCategoryId,@Param("table_prefix") String table_prefix);

    int updateByPrimaryKeySelective(@Param("record") ProductCategory record,@Param("table_prefix") String table_prefix);

    int updateByPrimaryKey(@Param("record") ProductCategory record,@Param("table_prefix") String table_prefix);
    //根据分类id list 从os_product_category表获取商品id list
    List<Long> getProductIdListByCategoryIdList(@Param("categoryIdList") List<Long> categoryIdList,@Param("table_prefix") String tablePrefix);
    //根据商品id 查询商品规格表list
    List<ProductCategory> getProductCategoryByProductId(@Param("productId")Long productId,@Param("table_prefix") String tablePrefix);
     //foreach 批量插入，此方法插入数据必须包含全部字段
    int insertList(@Param("productCategorys") List<ProductCategory> productCategorys,@Param("table_prefix") String table_prefix);

    //通过商品id删除商品分类
    int deleteByProductId(@Param("product_id") Long productId,@Param("table_prefix") String table_prefix);
}